package com.itsitio.registeradmin.enums;

import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.List;

public enum RegistrationStatus {
	NUEVA(1,"nueva", "Nueva"),
	ANALISIS(2,"analisis", "Analizada"),
	PENDIENTE(3,"pendiente", "Pendiente"),
	RECHAZADA(4,"rechazada", "Rechazada"),
	PRE_ACEPTADA(5,"pre-aceptada", "Pre-aceptada"),
	ACEPTADA(6,"aceptada", "Aceptada"),
	BAJA(7,"baja", "Dada de baja"),
	NUEVA_RADIOS(8,"nueva Radios", "Nueva radios"),
	BORRADOR(9,"borrador", "En borrador"),
	EMBLUE(10,"Emblue", "Emblue"),
	MODIFICADA(11, "modificacion", "Modificada");
	
	private Integer id;
	private String value;
	private String description;
	
	public static RegistrationStatus getStatus(Integer id){
		switch (id) {
		case 1:
			return NUEVA;
		case 2:
			return ANALISIS;
		case 3:
			return PENDIENTE;
		case 4:
			return RECHAZADA;
		case 5:
			return PRE_ACEPTADA;
		case 6:
			return ACEPTADA;
		case 7:
			return BAJA;
		case 8:
			return NUEVA_RADIOS;
		case 9:
			return BORRADOR;
		case 10:
			return EMBLUE;
		case 11:
			return MODIFICADA;	
		default:
			throw new InvalidParameterException("Status desconocido: "
					+ id);
		}
	}	
	
	private RegistrationStatus(Integer id, String value, String description) {
		this.id = id;
		this.value = value;
		this.description = description;
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getValue() {
		return value;
	}


	public void setValue(String value) {
		this.value = value;
	}
	
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	

	public static List<RegistrationStatus> getStatusListForUserRegistrationFilter(){
		List<RegistrationStatus> statusList = new ArrayList<RegistrationStatus>();
		statusList.add(RegistrationStatus.NUEVA);
		statusList.add(RegistrationStatus.MODIFICADA);
		statusList.add(RegistrationStatus.PENDIENTE);
		statusList.add(RegistrationStatus.ACEPTADA);
		statusList.add(RegistrationStatus.RECHAZADA);
		statusList.add(RegistrationStatus.BAJA);
		return statusList;
		
	}
	
	public static List<RegistrationStatus> getStatusListForUserRegistrationUpdate(){
		List<RegistrationStatus> statusList = new ArrayList<RegistrationStatus>();
		statusList.add(RegistrationStatus.PENDIENTE);
		statusList.add(RegistrationStatus.ACEPTADA);
		return statusList;
		
	}
}
